package com.zhupf.springcloud.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {
    @Resource
    private RestTemplate restTemplate;

    private final String PAYMENT_URL = "http://cloud-zookeeper-provider";

    @GetMapping("/zookeeper")
    public String getOrder(){
        return restTemplate.getForObject(PAYMENT_URL+"/payment/zookeeper",String.class);
    }


}
